
#pragma once

#include "exhash.h"

/**
 * the hash can not overrun this number
 * in order to avoid overflow
 */
#define EX_HASH_MAX_INT_GUARD   (0x7FFFFFFF)

struct ExHashCalcTables
{
    struct ExHashTable *    etables;
    ExHashInt *             sums;
    size_t                  max_str_len;
};

/**
 * creates exact-hash tables, returns NULL if hash table is overran
 * e.g. it is not possible to create hash table for the given strings table
 */
struct ExHashCalcTables * create_ex_hash_tables(const char ** strs, size_t strs_count);

/**
 * frees ex hash calc tables created by \see create_ex_hash_tables
 * does nothing if an argument given is a null pointer
 */
void free_ex_hash_calc_tables(struct ExHashCalcTables * r);

